package amqp

import (
	log "github.com/sirupsen/logrus"
	"queue-gateway/config"
)

var Producers = make(map[string]*Producer)
var appConfig = config.App

func ProducersMustInit() {
	for k, v := range appConfig.Upstreams {
		log.Printf("bind upstream %s to rabbitmq, routekey:%s", k, v.Routekey)
		Producers[k] = NewProducer(appConfig.RabbitMQ.Exchange, v.Routekey)
	}
}
